package com.liu.domain;

import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by liu on 17-9-12.
 */
@Entity
@Table(name = "student")
public class student {
    @Id
    private String stu_id;      //学生号
    private int room_id;      //房间编号
    private String r_id;   //页面显示的寝室号
    private String name;    //姓名
    private String sex;      //性别
    private String password = "123";   //密码
    private String acad = " ";     //学院
    private String pro = " ";     //省份
    @Temporal(TemporalType.DATE)
    private Date time = new Date();      //学生入学时间
    @Temporal(TemporalType.DATE)
    private Date birthday = new Date();   //出生日期
    private String cla;            //班级
    private String phone = " ";    //手机号码
    private int role=0;                 //角色 0代表学生

    public int getRole() {
        return role;
    }

    public String getR_id() {
        return r_id;
    }

    public void setR_id(String r_id) {
        this.r_id = r_id;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAcad() {
        return acad;
    }

    public void setAcad(String acad) {
        this.acad = acad;
    }

    public String getPro() {
        return pro;
    }

    public void setPro(String pro) {
        this.pro = pro;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getCla() {
        return cla;
    }

    public void setCla(String cla) {
        this.cla = cla;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getStu_id() {
        return stu_id;
    }

    public void setStu_id(String stu_id) {
        this.stu_id = stu_id;
    }

    public int getRoom_id() {
        return room_id;
    }

    public void setRoom_id(int room_id) {
        this.room_id = room_id;
    }

    @Override
    public String toString() {
        return "{" +
                "\"stu_id\":" + stu_id +
                ", \"room_id\":" + room_id +
                ", \"name\":\"" + name + '\"' +
                ", \"r_id\":\"" + r_id + '\"' +
                ", \"sex\":\"" + sex + '\"' +
                ", \"password\":\"" + password + '\"' +
                ", \"acad\":\"" + acad + '\"' +
                ", \"pro\":\"" + pro + '\"' +
                ", \"time\":\"" + time + '\"'+
                ", \"birthday\":\"" + birthday +'\"' +
                ", \"phone\":\"" + phone + '\"' +
                ", \"cla\":\"" + cla + '\"' +
                '}';
    }
}
